package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Created with IntelliJ IDEA.
 * User: ruchita
 * Date: 25/9/13
 * Time: 11:32 AM
 * To change this template use File | Settings | File Templates.
 */

public class BooksSampleDatabase {
    //created hashmap datastructure for storing book name and avaibility ie A or NA
    public HashMap<String,String> bookInfo=new HashMap<String,String>();

    public  void createDatabase() {
        bookInfo.put("Alchemist","A");
        bookInfo.put("Alchemist1","NA");
        bookInfo.put("Alchemist2","A");
        bookInfo.put("Alchemist3","NA");
        bookInfo.put("Alchemist4","A");
    }


    public ArrayList<String> getBookList() {
        ArrayList bookArray=new ArrayList();
        for(String BookName:bookInfo.keySet())
            bookArray.add(BookName);
        return  bookArray;
    }
}